// 获取数组的第一个
// 先判断数组是否有长度属性
// T extends {length:0} 可以判断范型的length是否为0
type First<T extends any[]> = T extends {length:0} ? never : T[0]


type arr1 = ['a', 'b', 'c']
type arr2 = [3, 2, 1]
type arr3 = []

type head1 = First<arr1> // expected to be 'a'
type head2 = First<arr2> // expected to be 3
type head3 = First<arr3> // expected to be never